import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import site from './modules/site'
import createPersistedState from "vuex-persistedstate"


Vue.use(Vuex)

// 模块化开发
const store = new Vuex.Store({
  modules: {
    user,
    site,
  },
  plugins: [createPersistedState({
    storage: window.sessionStorage,//会话存储网站配置信息
    key: 'siteConfigKey', // 存储 'site' 模块的键
    // paths: ['site'], // 指定要存储的模块路径
  })]
})

export default store
